package com.linkme2night.model;

//import java.util.ArrayList;

public class RateDAO {

	//private static String[] cid;
	//private static String[] name;
	//private static ArrayList<String> output = new ArrayList<String>();
	
	//Empty constructor
	public RateDAO(){
		
	    
	}
	
	//Add rateing to xml file
	public void addRate(Rate rate) {

		String[] c = { "ClubberId", "VenueId", "Rating" };
		String[] e = { Integer.toString(rate.getClubberID()),
				Integer.toString(rate.getVenueID()),
				Float.toString(rate.getRate()), null };
		try {
			CreateXml.CreateXml("Rate", c, e);
		} catch (Exception o) {
			System.out.println(o.getMessage());
		}
	}
	
	//unused fetch method
	  public String[] getRate(int id){
	 /* 
	 * XmlCon.LoadFile(); XmlCon.LoadFile(); Document doc = XmlCon.getDoc();
	 * NodeList nodeList = doc.getElementsByTagName("Rate"); cid = new
	 * String[nodeList.getLength()]; name = new String[nodeList.getLength()];
	 * String[] output = new String[nodeList.getLength()]; NodeList nameList =
	 * null; NodeList cidList;
	 * 
	 * 
	 * for (int i = 0; i < nodeList.getLength(); i++) { try{ Node node =
	 * nodeList.item(i);
	 * 
	 * Element fstElmnt = (Element) node; cidList =
	 * fstElmnt.getElementsByTagName("VenueId"); Element cidElement = (Element)
	 * cidList.item(0); cidList = cidElement.getChildNodes();
	 * 
	 * System.out.println("" + cidList.item(0).getNodeValue());
	 * if(cidList.item(0).getNodeValue().equals(""+id)) { nameList =
	 * fstElmnt.getElementsByTagName("Rating"); Element nameElement = (Element)
	 * nameList.item(0); nameList = nameElement.getChildNodes(); output[i] = (""
	 * + ((Node) nameList.item(0)).getNodeValue());
	 * 
	 * }
	 * 
	 * }catch(Exception e){System.out.println(e.getMessage());}
	 * 
	  } */ //return output
		  return null; 
	  
	  }
}